import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description: 输入密码登录
 * Author:  LiuTao
 * Version: 1.0
 * Date:    2023-07-30  16:29
 */
public class Test5 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int count = 3;
        while (count != 0) {
            System.out.println("请输入密码，你还有" + count + "次机会！");
            String password = scanner.nextLine();
            if(password.equals("liutao520")) {
                System.out.println("恭喜你，密码输入正确！");
                break;
            }else {
                System.out.println("很遗憾，密码输入错误！");
                count--;
            }
        }
    }
}
